1. Field of the Invention
The present invention relates to an obstacle detecting apparatus and method, and a storage medium storing a program for detecting obstacles, in which obstacles are detected using a distance image (which indicates the distance of each measurement point) when a robot or vehicle moves.
2. Description of the Related Art
In conventional obstacle detecting methods, some constraints are imposed on the shapes of target objects to be detected (i.e., obstacles), and the obstacle detection is performed under the above constraints, by using a concentration image (based on the gray scale) or a distance image.
However, in actual indoor environments in which robots move, or on general roads on which vehicles drive, obstacles having various shapes exist; thus, it is not practical to detect obstacles under such constraints imposed on the shapes.
On the other hand, an obstacle map called an elevation map is known, in which each cell in a two-dimensional grid has assigned data relating to the height or the probability of existence. However, the method using the elevation map requires complicated operations using, for example, a potential-field method, so as to select a route for avoiding obstacles.
In consideration of the above circumstances, an objective of the present invention is to provide an obstacle detecting apparatus and method, and a storage medium storing a program for detecting obstacles, by which obstacles can be reliably detected so that a self-controlled robot or vehicle can drive safely.
Therefore, the present invention provides an obstacle detecting apparatus comprising:
a distance image obtaining section having a distance sensor, for measuring the distance of each measurement point of objects existing in a visual field in front of the distance sensor and obtaining a three-dimensional coordinate value for each measurement point, and generating a distance image based on the three-dimensional coordinate values of the measurement points;
a histogram generating section for:
projecting each measurement point of the objects onto a predetermined plane which is divided into grid cells; and
calculating the number of the measurement points projected onto each grid cell in the plane, and generating a three-dimensional histogram indicating the distribution of the measurement points in the grid cells; and
an obstacle map generating section for extracting one or more obstacles and generating an obstacle map based on the histogram, where the positional relationship between the distance sensor and each obstacle is determined by the obstacle map.
As a more specific structure, the present invention provides an obstacle detecting apparatus comprising:
a distance image obtaining section (e.g., the distance image obtaining section 1 in the embodiment explained below) having a distance sensor, for measuring the distance of each measurement point of objects existing in a visual field in front of the distance sensor and obtaining a three-dimensional coordinate value for each measurement point, and generating a distance image based on the three-dimensional coordinate values of the measurement points;
a histogram generating section (e.g., the image processing section 3 and histogram storage section 4 in the embodiment explained below) for:
projecting each measurement point of the objects onto at least one of predetermined horizontal and vertical planes, where each plane is divided into grid cells, and the resolution of the divided grid cells is lower than the measurement resolution of the distance sensor; and
calculating the number of the measurement points projected onto each grid cell in the relevant plane, and generating a three-dimensional histogram indicating the distribution of the measurement points in the grid cells;
a binary converting section (e.g., the image processing section 3 in the embodiment explained below) for converting the histogram to binary data by comparing the histogram with a predetermined threshold value; and
an obstacle map generating section (e.g., the image processing section 3 and obstacle map storage section 6 in the embodiment explained below) for extracting one or more obstacles by performing a clustering operation on the binary data obtained by the binary converting section, and generating an obstacle map by which the positional relationship between the distance sensor and each obstacle is determined.
According to the above structure, a histogram is generated by projecting the measurement points in the distance image onto each of one or two planes, and the obstacle map is generated based on the histogram(s). Therefore, obstacles can be easily detected, and the environment around the relevant vehicle, robot, or the like (which has this obstacle detection apparatus) can be easily recognized.
The obstacle detecting apparatus may further comprise a correcting section (e.g., the image processing section 3 and lookup table 5 in the embodiment explained below) for correcting the number of the measurement points projected onto each grid cell, calculated by the histogram generating section, based on the distance from the distance sensor to each measurement point.
In this case, the data are corrected according to each distance (of the measurement point) to the object; thus, the accuracy of the obstacle map can be improved.
The present invention also provides a vehicle drive control apparatus comprising an obstacle detecting apparatus as explained above, comprising:
a movement control section (e.g., the movement control section 7 in the embodiment explained below) for controlling the driving of a vehicle by referring to the obstacle map and controlling the vehicle to avoid the obstacles defined in the obstacle map.
According to this structure, the environment around the vehicle can be easily recognized, and the positioning control of the vehicle can be performed with high accuracy.
The present invention also provides a self-controlled robot comprising an obstacle detecting apparatus as explained above, comprising:
a movement control section (e.g., the movement control section 7 in the embodiment explained below) for controlling the movement of the robot by referring to the obstacle map and making the robot avoid the obstacles defined in the obstacle map.
According to this structure, the environment around the robot can be easily recognized, and the positioning control of the robot can be performed with high accuracy.
The present invention also provides an obstacle detecting method comprising:
a distance image obtaining step of measuring the distance of each measurement point of objects existing in a visual field in front of a distance sensor and obtaining a three-dimensional coordinate value for each measurement point, and generating a distance image based on the three-dimensional coordinate values of the measurement points;
a histogram generating step of:
projecting each measurement point of the objects onto a predetermined plane which is divided into grid cells; and
calculating the number of the measurement points projected onto each grid cell in the plane, and generating a three-dimensional histogram indicating the distribution of the measurement points in the grid cells; and
an obstacle map generating step of extracting one or more obstacles and generating an obstacle map based on the histogram, where the positional relationship between the distance sensor and each obstacle is determined by the obstacle map.
As a more specific method, the present invention provides an obstacle detecting method comprising:
a distance image obtaining step (corresponding to, for example, step S1 in the embodiment explained below) of measuring the distance of each measurement point of objects existing in a visual field in front of a distance sensor and obtaining a three-dimensional coordinate value for each measurement point, and generating a distance image based on the three-dimensional coordinate values of the measurement points;
a histogram generating step (corresponding to, for example, steps S2 to S5 in the embodiment explained below) of:
projecting each measurement point of the objects onto at least one of predetermined horizontal and vertical planes, where each plane is divided into grid cells, and the resolution of the divided grid cells is lower than the measurement resolution of the distance sensor; and
calculating the number of the measurement points projected onto each grid cell in the relevant plane, and generating a three-dimensional histogram indicating the distribution of the measurement points in the grid cells;
a binary converting step (corresponding to, for example, steps S7 to S10 in the embodiment explained below) of converting the histogram to binary data by comparing the histogram with a predetermined threshold value; and
an obstacle map generating step (corresponding to, for example, step S11 in the embodiment explained below) of extracting one or more obstacles by performing a clustering operation on the binary data obtained in the binary converting step, and generating an obstacle map by which the positional relationship between the distance sensor and each obstacle is determined.
According to the above method, the histogram is generated by projecting the measurement points in the distance image onto each of one or two planes, and the obstacle map is generated based on the histogram(s). Therefore, obstacles can be easily detected, and the environment around the relevant vehicle, robot, or the like (which has this obstacle detection apparatus) can be easily recognized.
The obstacle detecting method may further comprise a correcting step (corresponding to, for example, step S6 in the embodiment explained below) of correcting the number of the measurement points projected onto each grid cell, calculated in the histogram generating step, based on the distance from the distance sensor to each measurement point.
In this case, the data are corrected according to each distance (of the measurement point) to the object; thus, the accuracy of the obstacle map can be improved.
The present invention also provides a computer readable storage medium storing a program for making a computer execute an operation of detecting obstacles existing in a visual field of a distance sensor, the operation comprising:
a distance image obtaining step of measuring the distance of each measurement point of objects existing in a visual field in front of a distance sensor and obtaining a three-dimensional coordinate value for each measurement point, and generating a distance image based on the three-dimensional coordinate values of the measurement points;
a histogram generating step of:
projecting each measurement point of the objects onto a predetermined plane which is divided into grid cells; and
calculating the number of the measurement points projected onto each grid cell in the plane, and generating a three-dimensional histogram indicating the distribution of the measurement points in the grid cells; and
an obstacle map generating step of extracting one or more obstacles and generating an obstacle map based on the histogram, where the positional relationship between the distance sensor and each obstacle is determined by the obstacle map.
As a computer readable storage medium storing a more specific program, the present invention provides a computer readable storage medium storing a program for making a computer execute an operation of detecting obstacles existing in a visual field of a distance sensor, the operation comprising:
a distance image obtaining step of measuring the distance of each measurement point of objects existing in a visual field in front of a distance sensor and obtaining a three-dimensional coordinate value for each measurement point, and generating a distance image based on the three-dimensional coordinate values of the measurement points;
a histogram generating step of:
projecting each measurement point of the objects onto at least one of predetermined horizontal and vertical planes, where each plane is divided into grid cells, and the resolution of the divided grid cells is lower than the measurement resolution of the distance sensor; and
calculating the number of the measurement points projected onto each grid cell in the relevant plane, and generating a three-dimensional histogram indicating the distribution of the measurement points in the grid cells;
a binary converting step of converting the histogram to binary data by comparing the histogram with a predetermined threshold value; and
an obstacle map generating step of extracting one or more obstacles by performing a clustering operation on the binary data obtained in the binary converting step, and generating an obstacle map by which the positional relationship between the distance sensor and each obstacle is determined.
In the computer readable storage medium, the operation may further comprise a correcting step of correcting the number of the measurement points projected onto each grid cell, calculated in the histogram generating step, based on the distance from the distance sensor to each measurement point.